Make the behaviour of the about dialog consistent with other dialogs in
authorMatthias Clasen <mclasen@redhat.com>
Fri, 10 Mar 2006 22:05:36 +0000 (22:05 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 10 Mar 2006 22:05:36 +0000 (22:05 +0000)
2006-03-10  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkaboutdialog.c (gtk_show_about_dialog): Make the behaviour
of the about dialog consistent with other dialogs in gtk. If the
dialog is constructed with gtk_about_dialog_new(), the creator
is reponsible for handling the response by hiding or closing the
dialog. gtk_show_about_dialog() handles it by hiding the dialog.
(#333360, Daniel Drake)

* README.in: Mention this change.

ChangeLog
ChangeLog.pre-2-10
README.in
gtk/gtkaboutdialog.c

index 12edb1e75cee95e38e90b60fc8bc568642f32da7..b4e3d60e544783d21e6a4220ae23eb57eb6266ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Make the behaviour
+       of the about dialog consistent with other dialogs in gtk. If the
+       dialog is constructed with gtk_about_dialog_new(), the creator
+       is reponsible for handling the response by hiding or closing the
+       dialog. gtk_show_about_dialog() handles it by hiding the dialog.
+       (#333360, Daniel Drake)
+
+       * README.in: Mention this change.
+
 2006-03-10  Matthias Clasen  <mclasen@redhat.com>
 
        Apply a patch from Dennis Cranston to make dialogs more
index 12edb1e75cee95e38e90b60fc8bc568642f32da7..b4e3d60e544783d21e6a4220ae23eb57eb6266ab 100644 (file)
@@ -1,3 +1,14 @@
+2006-03-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Make the behaviour
+       of the about dialog consistent with other dialogs in gtk. If the
+       dialog is constructed with gtk_about_dialog_new(), the creator
+       is reponsible for handling the response by hiding or closing the
+       dialog. gtk_show_about_dialog() handles it by hiding the dialog.
+       (#333360, Daniel Drake)
+
+       * README.in: Mention this change.
+
 2006-03-10  Matthias Clasen  <mclasen@redhat.com>
 
        Apply a patch from Dennis Cranston to make dialogs more
index ded0f904331ee80586558a7c2d15b1fab7393f0d..06318a0f85a49cb454eb0608fae07c4dce841533 100644 (file)
--- a/README.in
+++ b/README.in
@@ -56,6 +56,10 @@ Release notes for 2.10
   and GtkExpander) and resize grips, using the new EXPANDER and
   RESIZE_GRIP function values.
 
+* Dialogs created by gtk_about_dialog_new no longer hide automatically
+  when the user clicks close. It is the applications responsibility to
+  hide or destroy the dialog.
+
 Release notes
 =============
 
index 5ab9b77cad1edf10c3e9ff1c8e0f37a95a7ef849..7acd0da0b0c898a75a6fec6972231f10ea6c4f19 100644 (file)
@@ -529,9 +529,6 @@ gtk_about_dialog_init (GtkAboutDialog *about)
   /* force defaults */
   gtk_about_dialog_set_name (about, NULL);
   gtk_about_dialog_set_logo (about, NULL);
-
-  /* Close dialog on user response */
-  g_signal_connect (about, "response", G_CALLBACK (close_cb), NULL);
 }
 
 static void
@@ -2122,27 +2119,6 @@ display_license_dialog (GtkWidget *button,
   gtk_widget_show_all (dialog);
 }
 
-static void 
-close_cb (GtkAboutDialog *about)
-{
-  GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
-
-  if (priv->license_dialog != NULL)
-    {
-      gtk_widget_destroy (priv->license_dialog);
-      priv->license_dialog = NULL;
-    }
-
-  if (priv->credits_dialog != NULL)
-    {
-      gtk_widget_destroy (priv->credits_dialog);
-      priv->credits_dialog = NULL;
-    }
-
-  gtk_widget_hide (GTK_WIDGET (about));
-  
-}
-
 /**
  * gtk_about_dialog_new:
  *
@@ -2224,6 +2200,27 @@ gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func,
   return old;
 }
 
+static void 
+close_cb (GtkAboutDialog *about)
+{
+  GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
+
+  if (priv->license_dialog != NULL)
+    {
+      gtk_widget_destroy (priv->license_dialog);
+      priv->license_dialog = NULL;
+    }
+
+  if (priv->credits_dialog != NULL)
+    {
+      gtk_widget_destroy (priv->credits_dialog);
+      priv->credits_dialog = NULL;
+    }
+
+  gtk_widget_hide (GTK_WIDGET (about));
+  
+}
+
 /**
  * gtk_show_about_dialog:
  * @parent: transient parent, or %NULL for none
@@ -2258,6 +2255,9 @@ gtk_show_about_dialog (GtkWindow   *parent,
 
       g_signal_connect (dialog, "delete_event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
+      /* Close dialog on user response */
+      g_signal_connect (dialog, "response", G_CALLBACK (close_cb), NULL);
+
       va_start (var_args, first_property_name);
       g_object_set_valist (G_OBJECT (dialog), first_property_name, var_args);
       va_end (var_args);